// import "babel-polyfill";
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueRouter from 'vue-router'
import store from './store'

router.beforeEach((to, from, next) => {
    if (to.meta.title) {document.title = to.meta.title}/* 路由发生变化修改页面title */
    if (to.path === '/do') {document.title = store.state.titletxt}/* 路由发生变化修改页面title */
    next()
})

//解决 “路由重复导致溢出报错”
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

import 'lib-flexible/flexible.js';//移动端适配方案

import 'typeface-roboto';

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
Vue.use(MuseUI);

import 'muse-ui-message/dist/muse-ui-message.css';
import Message from 'muse-ui-message';
Vue.use(Message);

import flit from './flit';
Vue.use(flit);

import axios from './api';
Vue.use(axios);

// import VueAwesomeSwiper from 'vue-awesome-swiper';
// import 'swiper/css/swiper.css';
// Vue.use(VueAwesomeSwiper);

Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
